package com.wanxi.service;

import com.wanxi.dao.BrandDao;
import com.wanxi.model.BrandModel;

import java.util.List;

public class BrandService {
    public int add(String name, String enterpriseName, String sort, String describe, String status) {
        return 0;
    }

    public int add(BrandModel model) {
        BrandDao brandDao = new BrandDao();
//        if (model.getAge() == 10000) {
//            model.setAge(10);
//        }
//        if (model.getAge() == -100) {
//            model.setAge(0);
//        }
        return brandDao.add(model);
    }

    public List<BrandModel> find() {
        BrandDao brandDao = new BrandDao();
        return brandDao.find();
    }

    public int delete(BrandModel model) {
        BrandDao brandDao = new BrandDao();
        return brandDao.delete(model);
    }

    public BrandModel findById(BrandModel model) {
        BrandDao brandDao = new BrandDao();
        return brandDao.findById(model);
    }

    public int update(BrandModel model) {
        BrandDao brandDao = new BrandDao();
        return brandDao.update(model);
    }
}
